<include file="public:header" />


    <div id="loadCurPos" class="container content-nav-path">
        <a href="{:U('/')}">首页</a> <span class="arrow">></span> <a href="#">报名赛事</a> <span class="arrow">></span> 填写详细资料
    </div>

    <div class="title-main">
        <div class="container">
            <span class="text">2017成都国际马拉松赛<small>上传参赛资料</small></span>
        </div>
    </div>

    <div class="container main-content">

        <form class="form-horizontal form-mc" id="form_input" name="form_input" method="post" enctype="multipart/form-data"  action="{:U('baoming/attach_sub')}">
            <div class="form-group">
                <label class="col-sm-3 control-label multi">报名费：<span class="en">Entry fee</span></label>
                <div class="col-sm-6">
                    <p class="form-control-static"><?php echo $order_info['amount_total'];?>元</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi"><span class="require-star">*</span>马拉松项目体检证明：<span class="en">Medical Report</span></label>
                <div class="col-sm-8 form-inline file-group">
                    <input type="text" class="form-control"  id="photoCover" readonly >
                    <span class="file-button">
                        <input name="photo_normal" id="lefile" type="file" >
                        <button type="button" class="btn btn-info-r p-20">浏览 Browse</button>
                    </span>
                    <!--<button type="button" class="btn btn-info p-20" >上传</button>-->
                    <?php if($order_info['cert_medical']!=''){ ?><a href="<?php echo $order_info['cert_medical']; ?>" target="_blank"  class="btn btn-info p-20">查看 View</a><?php } ?>
                </div>
                
            </div>
            <!--
            <div class="form-group">
                <label class="col-sm-3 control-label multi">最好成绩赛事：<span class="en">Best performance event</span></label>
                <div class="col-sm-6">
                    <input type="text" class="form-control" name="best_chengji_item" id="best_chengji_item" value="<?php echo $order_info['best_chengji_item'];?>">
                </div>
            </div>
            -->
            <div class="form-group">
                <label class="col-sm-3 control-label multi">完赛证书成绩：<span class="en">Best time</span></label>
                <div class="col-sm-6">
                    <input type="text" class="form-control" name="best_chengji_score" id="best_chengji_score" value="<?php echo $order_info['best_chengji_score'];?>">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi">半程3小时以内完赛证明；<br>全程6小时完赛证明：<span class="en">Race Certificate</span></label>
                <div class="col-sm-8 form-inline file-group">
                    <input type="text" class="form-control"  id="photoCover2" readonly>
                    <span class="file-button">
                        <input name="photo_normal2" id="lefile2" type="file">
                        <button type="button" class="btn btn-info-r p-20">浏览 Browse</button>
                    </span>
                    <!--<button type="button" class="btn btn-info p-20">上传</button>-->
                    <?php if($order_info['cert_chengji']!=''){ ?><a  href="<?php echo $order_info['cert_chengji']; ?>" target="_blank" class="btn btn-info p-20">查看 View</a><?php } ?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi"><span class="require-star">*</span>摆渡车：<span class="en">Shuttle Bus</span></label>
                <div class="col-sm-6">
                    <select class="form-control" name="bus_point" id="bus_point">
                         <option value="">请选择摆渡车 Please select Shuttle Bus</option>
                   	 <?php
			    		if(!empty($bus_point_list)){
						foreach ($bus_point_list as $k=>$v) {
					?>
                        <option value="<?php echo $v['title'];?>" <?php if ($order_info['bus_point']==$v['title']){echo 'selected';}?>><?php echo $v['title'];?></option>
                       <?php
				    }
				}
				?>
                    </select>
                </div>
            </div>
            
            <!--
            <div class="form-group">
                <label class="col-sm-3 control-label multi">衣服尺码：<span class="en">Clothes size</span></label>
                <div class="col-sm-9">
                    <div class="radio">
                        <label><input type="radio" name="cloth_size" id="cloth_size" value="S" <?php if ($order_info['cloth_size']=='S'){echo 'checked';}?> > S</label>
                        <label><input type="radio" name="cloth_size" id="cloth_size" value="M" <?php if ($order_info['cloth_size']=='M'){echo 'checked';}?> > M</label>
                        <label><input type="radio" name="cloth_size" id="cloth_size" value="L" <?php if ($order_info['cloth_size']=='L'){echo 'checked';}?> > L</label>
                        <label><input type="radio" name="cloth_size" id="cloth_size" value="XL" <?php if ($order_info['cloth_size']=='XL'){echo 'checked';}?> > XL</label>
                        <label><input type="radio" name="cloth_size" id="cloth_size" value="XXL" <?php if ($order_info['cloth_size']=='XXL'){echo 'checked';}?> > XXL</label>
                        <label><input type="radio" name="cloth_size" id="cloth_size" value="XXXL" <?php if ($order_info['cloth_size']=='XXXL'){echo 'checked';}?> > XXXL</label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi">是否医护跑者：<span class="en">Is the medical runner</span></label>
                <div class="col-sm-9">
                    <div class="radio">
                        <label><input type="radio" name="medical_runner" id="medical_runner" value="1" <?php if ($order_info['medical_runner']==1){echo 'checked';}?>> 是 Yes</label>
                        <label><input type="radio" name="medical_runner" id="medical_runner" value="2" <?php if ($order_info['medical_runner']==2){echo 'checked';}?> > 否 No</label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi">跑团名称：<span class="en">Running group name</span></label>
                <div class="col-sm-6">
                    <input type="text" class="form-control" name="running_group_name" id="running_group_name" value="<?php echo $order_info['running_group_name'];?>">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi">紧急联系人姓名：<span class="en">Emergency Contact Name</span></label>
                <div class="col-sm-6">
                    <input type="text" class="form-control"  name="ec_name" id="ec_name" value="<?php echo $order_info['ec_name'];?>">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi">紧急联系人与参赛者关系：<span class="en">Emergency contact with participant</span></label>
                <div class="col-sm-6">
                    <input type="text" class="form-control"  name="ec_relation" id="ec_relation" value="<?php echo $order_info['ec_relation'];?>">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi">紧急联系人电话：<span class="en">Emergency contact cell phone</span></label>
                <div class="col-sm-6">
                    <input type="text" class="form-control"  name="ec_phone" id="ec_phone" value="<?php echo $order_info['ec_phone'];?>">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label multi">紧急联系人地址：<span class="en">Emergency contact address</span></label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" placeholder="请填写详细地址 Please fill in the  address"  name="ec_address" id="ec_address" value="<?php echo $order_info['ec_address'];?>">
                </div>
            </div>
            -->
            
            <!--
            <div class="form-group">
                <label class="col-sm-3 control-label multi">是否需要中意人寿赠险：<span class="en">GENERALI CHINA free insurance</span></label>
                <div class="col-sm-9">
                    <div class="radio">
                        <label><input type="radio" name="renshou_zengxian" id="renshou_zengxian" value="1" <?php if ($order_info['renshou_zengxian']==1){echo 'checked';}?>> 是 Yes</label>
                        <label><input type="radio" name="renshou_zengxian" id="renshou_zengxian" value="2" <?php if ($order_info['renshou_zengxian']==2){echo 'checked';}?> > 否 No</label>
                        <span class="en"><a href="#" data-toggle="modal" data-target="#myModal">成都马拉松比赛赠险方案</a></span>
                    </div>
                </div>
            </div>
            -->
            <div class="form-group">
                <label class="col-sm-3 control-label multi"><span class="require-star">*</span>验证码：<span class="en">Identifying code</span></label>
                <div class="col-sm-9 form-inline inline">
                    <input type="text" class="form-control" size="8"  id="validate" name="validate"  onfocus="this.select();">
                    <img src="<?php echo __ROOT__;?>/validateimg.php" class="id-code-img" onclick="javascript:reloadVerificationCode();"  id="verifyImage">
                </div>
            </div>
            
            
             <div class="form-group" align="center">
               带“<span class="require-star">*</span>”为必填项
            </div>
            
            
            
            <div class="form-group">
                <div class="btn-mc-center">
                    <button type="button" class="btn btn-default" onclick="javascript:do_submit();">下一步</button>
                    <input type="hidden" name="order_id" id="order_id" value="<?php echo $order_info['id'];?>">
                </div>
            </div>
        </form>

    </div>





<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog modal-md" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">成都马拉松比赛赠险方案</h4>
            </div>
            <div class="modal-body text-center">
                <p>中意人寿温馨提示：您可免费获得一份10万交通意外、10万特定意外保险。</p>
                <p>e路通---10万免费交通意外、10万特定意外保障（30天）</p>

                <div class="table-mc1">
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>保险责任</th>
                                <th width="80">保额</th>
                                <th width="80">保障期间</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>公共交通工具（公共汽车、班车、出租车、电车、列车、轮船、民航等）</td>
                                <td>10万</td>
                                <td rowspan="2">30天</td>
                            </tr>
                            <tr>
                                <td>电梯或扶梯</td>
                                <td>10万</td>
                            </tr>
                        </tbody>
                    </table>
            </div>

                <p>生效日期：填表或中签当日领取，次日生效</p>
            </div>
        </div>
    </div>
</div>




<script type="text/javascript">
	$('input[id=lefile]').change(function() {
		$('#photoCover').val($(this).val());
	});
	$('input[id=lefile2]').change(function() {
		$('#photoCover2').val($(this).val());
	});
</script>



<script  type="text/javascript">

    function reloadVerificationCode(){
        document.getElementById('verifyImage').src = '<?php echo __ROOT__;?>/validateimg.php?'+Math.random();
        document.getElementById('validate').value = '';
    }
    
    
	function show_error(v){
		//alert(v);
		$.com.alert.open(v);
	}
	
	function do_submit(){
		
		var lefile=$("#lefile").val();
		var lefile2=$("#lefile2").val();
		
		//var best_chengji_item=$("#best_chengji_item").val();
		var best_chengji_score=$("#best_chengji_score").val();
		var bus_point=$("#bus_point").val();
		//var running_group_name=$("#running_group_name").val();
		//var ec_name=$("#ec_name").val();
		//var ec_relation=$("#ec_relation").val();
		//var ec_phone=$("#ec_phone").val();
		//var ec_address=$("#ec_address").val();
		//var renshou_zengxian=$("#renshou_zengxian").val();
		
		var validate=$("#validate").val();
		
		
		
		
		
	<?php if($order_info['cat_id']==1 || $order_info['cat_id']==2 || $order_info['cat_id']==4 || $order_info['cat_id']==5 ){ ?>
	
		<?php if($order_info['cert_medical']==''){ ?>
	        if (lefile==""){
	            show_error("请上传马拉松项目体检证明 Please Upload Medical Report");
	            return false;
	        }
	        else{
	        }
	        <?php } ?>
	        
	        
	        
	        
	        //if (best_chengji_item==""){
	        //    show_error("请输入最好成绩赛事 Please input Best performance event");
	        //    return false;
	        //}
	        //else{
	        //}
	        
	        
	        //if (best_chengji_score==""){
	        //    show_error("请输入完赛证书成绩 Please input Best time");
	        //    return false;
	        //}
	        //else{
	        //}
	        
	        
	        <?php if($order_info['cert_chengji']==''){ ?>
	        //if (lefile2==""){
	        //    show_error("请上传半程3小时以内完赛证明；全程6小时完赛证明 Please Upload Race Certificate");
	        //    return false;
	        //}
	        //else{
	        //}
	        <?php } ?>
	        
	        
       <?php } ?>
	        
	        
	        
	        if (bus_point==""){
	            show_error("请输入摆渡车 Please input Shuttle Bus");
	            return false;
	        }
	        else{
	        }
	        
	        
	        
	        
		/*
		var   sltSource=false;   
          for   (var   i=0;i<document.form_input.cloth_size.length;i++){   
              if   (document.form_input.cloth_size[i].checked==true)   sltSource=true;   
          }   
          if   (sltSource==false){   
              show_error("请输入衣服尺码 Please input Clothes size");
              document.form_input.cloth_size[0].focus();   
              return false;   
          }
		if (document.form_input.cloth_size[0].checked==true){
		var cloth_size='S';
		}
		if (document.form_input.cloth_size[1].checked==true){
		var cloth_size='M';
		}
		if (document.form_input.cloth_size[2].checked==true){
		var cloth_size='L';
		}
		if (document.form_input.cloth_size[3].checked==true){
		var cloth_size='XL';
		}
		if (document.form_input.cloth_size[4].checked==true){
		var cloth_size='XXL';
		}
		if (document.form_input.cloth_size[5].checked==true){
		var cloth_size='XXXL';
		}



		var   sltSource=false;   
          for   (var   i=0;i<document.form_input.medical_runner.length;i++){   
              if   (document.form_input.medical_runner[i].checked==true)   sltSource=true;   
          }   
          if   (sltSource==false){   
              show_error("请输入是否医护跑者 Please input Is the medical runner");
              document.form_input.medical_runner[0].focus();   
              return false;   
          }
		if (document.form_input.medical_runner[0].checked==true){
		var medical_runner='1';
		}
		if (document.form_input.medical_runner[1].checked==true){
		var medical_runner='2';
		}





	        //if (running_group_name==""){
	          //  show_error("请输入跑团名称 Please input Running group name");
	           // return false;
	        //}
	        //else{
	        //}
	        
	        
	        
	        if (ec_name==""){
	            show_error("请输入紧急联系人姓名 Please input Emergency Contact Name");
	            return false;
	        }
	        else{
	        }
	        
	        
	        if (ec_relation==""){
	            show_error("请输入紧急联系人与参赛者关系 Please input Emergency contact with participant");
	            return false;
	        }
	        else{
	        }
	        
	        
	        if (ec_phone==""){
	            show_error("请输入紧急联系人电话 Please input Emergency contact cell phone");
	            return false;
	        }
	        else{
	        }
	        
	        
	        
	        
	        if (ec_address==""){
	            show_error("请输入紧急联系人地址 Please input Emergency contact address");
	            return false;
	        }
	        else{
	        }
	        */
	        
	        
	        
	        
	        /*
		var   sltSource=false;   
          for   (var   i=0;i<document.form_input.renshou_zengxian.length;i++){   
              if   (document.form_input.renshou_zengxian[i].checked==true)   sltSource=true;   
          }   
          if   (sltSource==false){   
              show_error("请输入是否需要中意人寿赠险 Please input GENERALI CHINA free insurance");
              document.form_input.renshou_zengxian[0].focus();   
              return false;   
          }
		if (document.form_input.renshou_zengxian[0].checked==true){
		var renshou_zengxian='1';
		}
		if (document.form_input.renshou_zengxian[1].checked==true){
		var renshou_zengxian='2';
		}
	        */
	        
		        
	        if (validate==""){
	         	show_error("请输入正确的验证码 Please input Identifying code");
		       return false;
	        }
	         else{
		   }
	        
	        
	        
	        
	        
            $.ajax({
                url: "<?php echo __ROOT__;?>/baoming/validate_sub",
                async: false,
                type: "POST",
                dataType: "json",
                data: {validate:validate
                },
                success: function(ret){
                    if(ret.success=='success'){
				
				document.form_input.submit();
                    
                    }
                    else{
	                	show_error(ret.success);
	              	return false;
	                }
                }
            });
            
            
            
            
	        
	        
	        
        /*
        $.ajax({
            url: "<?php echo __ROOT__;?>/baoming/attach_sub",
            async: false,
            type: "POST",
            dataType: "json",
            data: {
            cat_id:cat_id,
            realname:realname,
            sex:sex,
            birth_day:birthday,
            id_type:id_type,
            id_number:id_number,
            address:address,
            mobile:mobile,
            email:email,
            cityarea:cityarea,
            blood:blood
            
            
            },
            success: function(ret){
                if(ret.success=='success'){
                    location.href="<?php echo __ROOT__;?>/baoming/apply_finish";
                }
                else{
                	 show_error(ret.success);
	              return false;
                }
            }
        });
        */
        
	}
</script>







    <script src="<?php echo STATICSPATH;?>scripts/app/enroll/info2.js" type="text/javascript"></script>

<include file="public:footer" />